<?php $this->load->view('header2') ?>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>js/uploadify/uploadify.css" />
<script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo base_url(); ?>js/uploadify/jquery.uploadify.v2.1.0.min.js"></script>

<script type="text/javascript" src="<?php echo base_url(); ?>js/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/stringToSlug/jquery.stringToSlug.min.js"></script>
<script type="text/javascript">
       
      
    $(document).ready(function() {
               
        $.ajaxSetup({ cache: false });
			
        $("#upload-photo").uploadify({
            uploader: '<?php echo base_url(); ?>js/uploadify/uploadify.swf',
            script: '<?php echo base_url(); ?>js/uploadify/uploadify.php',
            cancelImg: '<?php echo base_url(); ?>js/uploadify/cancel.png',
            folder: '<?php echo $this->config->item('mediauploadpath_create'); ?>',
            scriptAccess: 'always',
            multi: true,
            'onError' : function (a, b, c, d) {
                if (d.status == 404)
                    alert('Could not find upload script.');
                else if (d.type === "HTTP")
                    alert('error '+d.type+": "+d.status);
                else if (d.type ==="File Size")
                    alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
                else
                    alert('error '+d.type+": "+d.text);
            },
            'onComplete'   : function (event, queueID, fileObj, response, data) {
                //Post response back to controller
                $.post('<?php echo base_url(); ?>media/view_uploadify',{filearray: response},function(info){
                    showmediaitem();                  
                });
									
									            
            }
        });
			
        function showmediaitem() {
	
            $('#mediaphoto_content').load('<?php echo base_url(); ?>media/showmediaitem');
		
        }
	
    });
</script>


<div id="content" class="pages">
    <form id="create_announcement_cat_form" class="form" action="<?php echo base_url(); ?>media/manage" method="post" enctype="multipart/form-data">

        <input type="hidden" name="posttype" value="1" />

        <div id="content-left">
            <div class="box">

                <a href="<?php echo base_url(); ?>media/l" class="button main_btn">Manage Media(s)</a>
            </div>

        </div>

        <div id="content-right">
            <div class="main-col">

                <div id="result" class="box result2">
                    <h1><img src="<?php echo base_url(); ?>images2/icon_announcement.png" alt="Icon Agent" /> &nbsp;<span>Upload Media(s)</span></h1>
                    <div class="box_content" style="min-height:500px;">

                        <div class="listing">


                            <form id="create_propertylisting" class="form" method="post" action="" enctype="multipart/form-data">

                                <div class="box_w_b_border">
                                    <div class="mediaphoto mediabox media">

                                        <div class="upload_portion">
                                            <label for="Filedata">Select file(s)</label><br/>
                                            <input type="file" name="Filedata" value="" id="upload-photo"  />                                            
                                            <a class="input_btn" href="javascript:$('#upload-photo').uploadifyUpload();">Upload File(s)</a>
                                        </div>



                                        <div id="mediaphoto_content" class="mediaphoto_content">



                                        </div>

                                    </div>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>
            </div>

    </form>



</div>


<?php
$this->load->view('footer2')?>